import dayjs from 'dayjs'
export default function (app) {
  const formatString = 'YYYY-MM-DD HH:mm:ss'
  app.directive('format-time', {
    
    mounted(el, bindings) {
      let value = parseInt(el.textContent)
      el.textContent.length === 10 && (value = value * 1000)
      el.textContent = dayjs(value).format(formatString)
    }
  })
}